import {
	USER_SET_USER_TOKEN,
	USER_SET_USER_INFO,
	USER_LOGOUT,
	USER_SET_AVATAR,
	USER_SET_NICKNAME,
	USER_SET_EMAIL
} from '../action-types'

/**
 * 设置用户Token
 * @param data {Object} token required
 * @returns {{data, type: string}}
 */
export const setUserToken = data => ({type: USER_SET_USER_TOKEN, data})

/**
 * 设置用户其他信息
 * @param data {Object}
 * @returns {{data, type: string}}
 */
export const userInfo = data => ({type: USER_SET_USER_INFO, data});

/**
 * 设置用户头像
 * @param data
 * @returns {{data, type: string}}
 */
export const setUserAvatar = data => ({type: USER_SET_AVATAR, data});
/**
 * 设置用户昵称
 * @param data
 * @returns {{data, type: string}}
 */
export const setUserNickname = data => ({type: USER_SET_NICKNAME, data});
/**
 * 设置用户邮箱
 * @param data
 * @returns {{data, type: string}}
 */
export const setUserEmail = data => ({type: USER_SET_EMAIL, data});

/**
 * 用户登出
 * @param data
 * @returns {{data, type: string}}
 */
export const userLogout = data => ({type: USER_LOGOUT, data})
